package br.com.empeng.model.entidades;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.SequenceGenerator;


@Entity
//@Table(name="aluno")
public class Aluno {
	
	@Id
	@SequenceGenerator(sequenceName="seq_aluno", name="seq_aluno",initialValue=1,allocationSize=1)
	@GeneratedValue(generator="seq_aluno", strategy=GenerationType.SEQUENCE)
	
	
	//@Column(name="nome", nullable=false,length=30,unique=false, columnDefinition="Nome do aluno")
	private Integer id;
	private String nome;
	
	@ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, mappedBy="alunos", targetEntity = Professor.class)

	private List<Professor> professores;
	
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getNome() {
		return nome;
	}
	public void setNome(String nome) {
		this.nome = nome;
	}
	public List<Professor> getProfessores() {
		return professores;
	}
	public void setProfessores(List<Professor> professores) {
		this.professores = professores;
	}
	
	
	
}
